import 'package:flutter/cupertino.dart';

typedef HeaderWidgetBuild = Widget Function(BuildContext context);
class BaseSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate{
  final HeaderWidgetBuild contentBuild;
  @override
  final double maxExtent;
  @override
  late final double minExtent;

  BaseSliverPersistentHeaderDelegate({required this.contentBuild,required this.maxExtent,double minExtent=0}){
     this.minExtent=minExtent==0?maxExtent:minExtent;
  }

  @override
  Widget build(BuildContext context, double shrinkOffset, bool overlapsContent)=>contentBuild(context);



  @override
  bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
    return false;
  }

}